<?php
//组合模式
class FlockDuck implements DuckInterface{
    protected $duck;
    public function add(DuckInterface $duck)
    {
        $this->duck[] = $duck;
    }

    public function quick()
    {
        foreach ($this->duck as $duck)
        {
            $duck->quick();
        }
    }
}